<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pepr3D: D:/Home/MFF/1-Mgr/projekt/pepr3d/src/commands/Command.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pepr3d_icon.svg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Pepr3D
   &#160;<span id="projectnumber">v1.0</span>
   </div>
   <div id="projectbrief">Pepr3D is a 3D graphics editor designed for FDM printing</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_command_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Command.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacepepr3d.html">pepr3d</a> {</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Target&gt;</div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="classpepr3d_1_1_command_base.html">   10</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpepr3d_1_1_command_base.html">CommandBase</a> {</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span>&gt;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classpepr3d_1_1_command_manager.html">CommandManager</a>;  <span class="comment">// allow only CM to run the commands</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;   <span class="keyword">public</span>:</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="classpepr3d_1_1_command_base.html#aa4644cac610c68ac671fbf04af61186f">   19</a></span>&#160;    <a class="code" href="classpepr3d_1_1_command_base.html#aa4644cac610c68ac671fbf04af61186f">CommandBase</a>(<span class="keywordtype">bool</span> isSlow = <span class="keyword">false</span>, <span class="keywordtype">bool</span> <a class="code" href="classpepr3d_1_1_command_base.html#aead9aa5e9149a485497805aa1a4527bf">canBeJoined</a> = <span class="keyword">false</span>) : mIsSlow(isSlow), mCanBeJoined(<a class="code" href="classpepr3d_1_1_command_base.html#aead9aa5e9149a485497805aa1a4527bf">canBeJoined</a>) {}</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classpepr3d_1_1_command_base.html">CommandBase</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <span class="keyword">virtual</span> std::string_view <a class="code" href="classpepr3d_1_1_command_base.html#a0b01d47e5d418d3c2e0aba612c88f42b">getDescription</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="classpepr3d_1_1_command_base.html#a861152ab2c31b4257cf99e351da91418">   26</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classpepr3d_1_1_command_base.html#a861152ab2c31b4257cf99e351da91418">isSlowCommand</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        <span class="keywordflow">return</span> mIsSlow;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    }</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classpepr3d_1_1_command_base.html#aead9aa5e9149a485497805aa1a4527bf">   31</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classpepr3d_1_1_command_base.html#aead9aa5e9149a485497805aa1a4527bf">canBeJoined</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="keywordflow">return</span> mCanBeJoined;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    }</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;   <span class="keyword">protected</span>:</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classpepr3d_1_1_command_base.html#a6943d010f181040692b0f023dbfc81e1">run</a>(Target&amp; target) <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classpepr3d_1_1_command_base.html#a9ef408154b7cb446e626e049f268abb4">   43</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classpepr3d_1_1_command_base.html#a9ef408154b7cb446e626e049f268abb4">joinCommand</a>(<span class="keyword">const</span> <a class="code" href="classpepr3d_1_1_command_base.html">CommandBase</a>&amp;) {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    }</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;   <span class="keyword">private</span>:</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">bool</span> mIsSlow;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">bool</span> mCanBeJoined;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}  <span class="comment">// namespace pepr3d</span></div><div class="ttc" id="classpepr3d_1_1_command_base_html_a9ef408154b7cb446e626e049f268abb4"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#a9ef408154b7cb446e626e049f268abb4">pepr3d::CommandBase::joinCommand</a></div><div class="ttdeci">virtual bool joinCommand(const CommandBase &amp;)</div><div class="ttdoc">Join this command with other command of the same commandType, uniting both commands into this command...</div><div class="ttdef"><b>Definition:</b> Command.h:43</div></div>
<div class="ttc" id="namespacepepr3d_html"><div class="ttname"><a href="namespacepepr3d.html">pepr3d</a></div><div class="ttdoc">Fix for CGAL bugs in polygon with holes verification Contained in CGAL PR #3688, likely to be in 4....</div><div class="ttdef"><b>Definition:</b> CmdColorManager.h:9</div></div>
<div class="ttc" id="classpepr3d_1_1_command_manager_html"><div class="ttname"><a href="classpepr3d_1_1_command_manager.html">pepr3d::CommandManager</a></div><div class="ttdoc">CommandManager handles all undoable operations on target in the form of commands See.</div><div class="ttdef"><b>Definition:</b> CommandManager.h:15</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html_a6943d010f181040692b0f023dbfc81e1"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#a6943d010f181040692b0f023dbfc81e1">pepr3d::CommandBase::run</a></div><div class="ttdeci">virtual void run(Target &amp;target) const =0</div><div class="ttdoc">Run the command, applying the modifications to the target.</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html_a0b01d47e5d418d3c2e0aba612c88f42b"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#a0b01d47e5d418d3c2e0aba612c88f42b">pepr3d::CommandBase::getDescription</a></div><div class="ttdeci">virtual std::string_view getDescription() const =0</div><div class="ttdoc">Get description of the command.</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html_a861152ab2c31b4257cf99e351da91418"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#a861152ab2c31b4257cf99e351da91418">pepr3d::CommandBase::isSlowCommand</a></div><div class="ttdeci">bool isSlowCommand() const</div><div class="ttdoc">Is command slow and thus snapshot will be created before next command.</div><div class="ttdef"><b>Definition:</b> Command.h:26</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html"><div class="ttname"><a href="classpepr3d_1_1_command_base.html">pepr3d::CommandBase</a></div><div class="ttdoc">CommandBase is a base class for commands representing a single undoable operation....</div><div class="ttdef"><b>Definition:</b> Command.h:10</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html_aead9aa5e9149a485497805aa1a4527bf"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#aead9aa5e9149a485497805aa1a4527bf">pepr3d::CommandBase::canBeJoined</a></div><div class="ttdeci">bool canBeJoined() const</div><div class="ttdoc">Can this command be joined with other commands of the same type.</div><div class="ttdef"><b>Definition:</b> Command.h:31</div></div>
<div class="ttc" id="classpepr3d_1_1_command_base_html_aa4644cac610c68ac671fbf04af61186f"><div class="ttname"><a href="classpepr3d_1_1_command_base.html#aa4644cac610c68ac671fbf04af61186f">pepr3d::CommandBase::CommandBase</a></div><div class="ttdeci">CommandBase(bool isSlow=false, bool canBeJoined=false)</div><div class="ttdef"><b>Definition:</b> Command.h:19</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_5e80d29b61c444378a543be4dd1414df.html">commands</a></li><li class="navelem"><b>Command.h</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
